home *** CD-ROM | disk | FTP | other *** search
/ 8bitfiles.net/archives / archives.tar / archives / compuserve-file-archive / 05 Programming / WINDOC.BIN < prev    next >
Text File  |  2019-04-13  |  8KB  |  178 lines

  1.  
  2.  
  3.  
  4.  
  5. WINDOW WONDER
  6. FOR C-128, 80-COLUMN TEXT SCREEN WITH RGBI MONITOR
  7.  
  8.      Even the most carefully written program can take several seconds
  9. to create an elaborate text screen or menu. If the program depends
  10. upon speed to produce a desired impact or reduce waiting time for the
  11. user, Window Wonder may be helpful.
  12.      Window Wonder, a machine language utility written for the
  13. Commodore C-128, allows the contents of the entire 80-column text
  14. screen or of a sub-window to be alternately stored into memory and then
  15. restored to the screen. BASIC 7.0's WINDOW command, however useful,
  16. lacks the provision to restore the screen once the WINDOW is removed.
  17. Window Wonder allows the emulation of pull-down menus heretofore found
  18. only in the most powerful home computers.
  19.      The C-128 eighty-column screen memory is a separate 16K of RAM
  20. contained in the 8563 chip. The screen can be accessed only through
  21. two registers shared by the 8563 chip and the C-128 I/O memory: the
  22. address register (54784) and the data register (54785) through which
  23. all information must serially pass to be printed to the screen. Since
  24. the 8563 chip is serviced by its own interrupt cycle, timing is
  25. ultimately important to insure that the data register contains valid
  26. information. If the task of reading data from the 8563 chip is
  27. attempted in BASIC, the result is painfully slow. Machine language,
  28. however, provides a lightning fast transfer of data.
  29.  
  30. DOWNLOADING THE WINDOW WONDER FILES
  31.      The Window Wonder machine language routine, called WINDOW.BIN/binary
  32. in this DL, should be saved to disk as "window.obj". Once window.obj
  33. is loaded into memory and initialized you may BSAVE the file on as many
  34. disks as you like by entering the following statement followed by
  35. RETURN: BSAVE"WINDOW.OBJ", B0, P8192 TO P8864.
  36.      An optional demonstration program written in BASIC, "WINDEM.BIN/binary,
  37. shows how Window Wonder is easily used in BASIC programming. The assembler
  38. source code is also included for your information. The source code is a
  39. sequential file called "WINSRC.SEQ", and should be read or printed in
  40. all capital letters (printer secondary address = 0).
  41.  
  42. SIMPLE SYNTAX
  43.      It is not necessary that the Window Wonder user have any
  44. any knowledge of ML programming as long as a few simple rules are
  45. observed. Since the 80-col. screen can fill most of the 8563 RAM, it
  46. was difficult to find a suitably large unused area in bank 0 of C-128
  47. memory in which to store screen data. I finally decided to use the 8K
  48. block of RAM occupied by the VIC bitmap beginning at location 8192. My
  49. rationale was that most programs utilizing the 80-col. screen handle
  50. text and don't require the bitmap. Normally BASIC program text begins
  51. at 8192. When the bitmap is allocated by using the command "GRAPHIC 1"
  52. the BASIC program is moved to RAM underlying BASIC LO ROM.
  53.      Although the Window Wonder ML routine allocates and clears the
  54. VIC bitmap during initialization, it is necessary to issue the BASIC
  55. command "GRAPHIC 1,1:GRAPHIC 0" (or "GRAPHIC 1,1:GRAPHIC 5" if you are
  56. already using the 80-col.screen) when BLOADing the binary file from a
  57. BASIC program. If this is not done the ML code will be loaded right
  58. over the BASIC program.
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. WINDOW WONDER                                                 page 2
  71.  
  72.      Window Wonder is initialized by the command SYS 8192.
  73. Initialization allocates and clears the bitmap, moves BASIC program
  74. text, prints a message to the screen, and sets the routine to "store"
  75. mode. The command SYS 8500 alternately "stores" and then "restores"
  76. the 80-col. screen. Window Wonder has a "back door" which initializes
  77. the routine without printing the opening message. Then it resets to
  78. the store mode, dumping any old screen previously stored. I call SYS
  79. 8463 the "back door" because originally I wasn't going to document
  80. it. See the flow chart below for a more graphic explanation.
  81.  
  82. PROGRAMMING PROCEDURES FLOW CHART
  83. U```````````````````````````````I U```````````````````````````````I
  84. }    starting in direct mode    } }     starting in basic prg.    }
  85. J```````````````2```````````````K J```````````````2```````````````K
  86.                 }                                 }
  87. U```````````````1```````````````I U```````````````1```````````````I
  88. } bload 'window.obj', b0, p8192 } }move basic, clr map:graphic 1,1}
  89. }     initialize: sys 8192      } J```````2````````````````2``````K
  90. J```````2```````````````2```````K         }                }
  91.         }               }         U```````1``````I U```````1``````I
  92. U```````1``````I U``````1```````I } 40 col. scrn.} } 80 col. scrn.}
  93. } 40 col. scrn.} } 80 col. scrn.} }   graphic 0  } }   graphic 5  }
  94. }change to rgbi} J``````2```````K J```````2``````K J```````2``````K
  95. J```````2``````K        }                 }                }
  96.         }               }         U```````1````````````````1``````I
  97. U```````1```````````````1```````I } bload 'window.obj', b0, p8192 }
  98. } develop or load basic program } }     initialize: sys 8192      }
  99. }              run              } J```````2````````````````2``````K
  100. J```````````````2```````````````K         }                }
  101.                 }                 U```````1``````I U```````1``````I
  102.                 }                 } 40 col. scrn.} } 80 col. scrn.}
  103.                 }                 }change to rgbi} J```````2``````K
  104.                 }                 J```````2``````K         }
  105. U```````````````1`````````````````````````1````````````````1``````I
  106. } to store: set window & sys 8500 then clear window & print menu  }
  107. } to restore: sys8500 then change window back again               _.
  108. J````````````````````````````````2````````````````````````````````K^
  109.                                  }                                 ^
  110. U````````````````````````````````1````````````````````````````````I^
  111. }   if nmi (run/stop, restore) occurs then use reset: sys 8463    +=
  112. J`````````````````````````````````````````````````````````````````K
  113.  
  114. IMPORTANT INFORMATION
  115.      Remember that Kernal and BASIC ROM, RAM(0) and I/O memory must be
  116. brought into context (BANK 15) when window.obj is called to prevent
  117. the occurrence of a system crash. It is important that the WINDOW size
  118. not be changed prior to restoring the screen. Also be certain to store
  119. a window before clearing it or you will subsequently restore a cleared
  120. window.
  121.  
  122. WINDOW WONDER TEST
  123.      You may test Window Wonder in the direct mode by entering the
  124. command SYS 8500 to store the screen, press SHIFT & CLR/HOME to
  125. clear the screen, and SYS 8500 again to restore the screen. The cursor
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. WINDOW WONDER                                                  page 3
  137.  
  138. returns to the screen at the same position it was when the ML routine
  139. was called. This test shows how window.obj may be used to quickly
  140. store and subsequently restore a complex screen without using the
  141. WINDOW command.
  142.  
  143. PRACTICAL DEMONSTRATION
  144.      WINDEM.BIN/binary, is a BASIC program that simulates an
  145. eighty-col. terminal. This program uses pull-down menus which may be
  146. called by pressing CONTROL and 1, 2 or 3. Press "7" to exit a menu and
  147. to return to "terminal" mode. The demo is not a functioning terminal
  148. but a practical example of how Window Wonder may be used in your own
  149. programming. By LISTing the program to the screen, the lines showing
  150. specific examples will be highlighted.
  151.  
  152. CONTINGENCY
  153.      All Window Wonder files copyright 1987 by Ron LeMon but are
  154. placed in the public domain contingent that they be creatively used
  155. and generously shared but never for profit!
  156.  
  157. SUMMARY
  158.      ALLOCATE & CLEAR BITMAP: GRAPHIC 1,1
  159.      SELECT 80-COL. SCREEN: GRAPHIC 5
  160.      BLOAD"WINDOW.OBJ", B0, P8192
  161.      BSAVE"WINDOW.OBJ", B0, P8192 TO P8864
  162.      (Default drive & device numbers are used)
  163.      INITIALIZE: SYS 8192
  164.      RESET (Back Door): SYS 8463
  165.      STORE or RESTORE: SYS 8500
  166.  
  167.                                                   Ron LeMon
  168.                                                   76556,2477
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.